import { ElNotification } from 'element-plus';

import { NotificationParam } from './notification-param';

export function showNotification(param: NotificationParam): void {
  ElNotification({
    title: param.title,
    message: param.message,
    position: param.position,
    type: param.type,
  });
}

export function showErrorNotification(message: string): void {
  const param = new NotificationParam();
  param.title = 'Error';
  param.type = 'error';
  param.message = message;

  showNotification(param);
}

export function showWarningNotification(message: string): void {
  const param = new NotificationParam();
  param.title = 'Warning';
  param.type = 'warning';
  param.message = message;

  showNotification(param);
}

export function showInfoNotification(message: string): void {
  const param = new NotificationParam();
  param.title = 'Info';
  param.type = 'info';
  param.message = message;

  showNotification(param);
}

export function showSuccessNotification(message: string): void {
  const param = new NotificationParam();
  param.title = 'Success';
  param.type = 'success';
  param.message = message;

  showNotification(param);
}
